<!--这个组件用于判断当前用户是否有某个权限，以便控制显示一些操作-->
<template >
  <div v-if="canShow">
    <slot name='content'></slot>
  </div>

</template>
<script>
  import {hasOneOf} from '@/libs/tools'
  export default{
    name: 'qauth',
    props: {
      access: {type: String, default: ''}
    },
    data(){
      return {
        content: ''
      }
    },
    computed: {
      canShow(){
        if (this.access !== ''&&this.access !== undefined) {
          return  hasOneOf([this.access], this.$store.getters.accessList);
        }else {
          return  false;
        }
      }
    }
  }
</script>
